package com.zycfc.zsf.boot.common.enums;

import com.zycfc.zsf.boot.util.common.*;

public enum ZsfNameSpace implements AbstractEnum<String>
{
    prod("90", "\u751f\u4ea7\u73af\u5883"), 
    local("10", "\u672c\u5730\u73af\u5883"), 
    dev("20", "\u5f00\u53d1\u73af\u5883"), 
    sit("30", "sit\u73af\u5883"), 
    sit2("80", "sit2\u73af\u5883"), 
    mig("60", "\u6570\u636e\u8fc1\u79fb"), 
    auto("50", "\u81ea\u52a8\u5316\u73af\u5883"), 
    pfm("70", "\u6570\u636e\u8fc1\u79fb"), 
    uat("40", "uat\u73af\u5883");
    
    private final String value;
    private final String message;
    
    private ZsfNameSpace(final String value, final String message) {
        this.value = value;
        this.message = message;
    }
    
    public static String getProfile(final String[] envs) {
        if (envs == null) {
            return null;
        }
        for (final ZsfNameSpace envName : values()) {
            for (final String env : envs) {
                if (envName.name().equals(env)) {
                    return env;
                }
            }
        }
        return null;
    }
    
    public static String getValue(final String nameSpace) {
        for (final ZsfNameSpace val : values()) {
            if (val.name().equals(nameSpace)) {
                return val.getValue();
            }
        }
        return "99";
    }
    
    public String getMessage() {
        return this.message;
    }
    
    public String getValue() {
        return this.value;
    }
}
